<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
  登录页面
  ${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}
  <%=request.getAttribute("failCode")%>
  ${failCode}
    <form class="loginForm" method="post" name="loginForm" id="loginForm" action="<%=basePath%>j_spring_security_check">
<div class="login">
	<div class="img"><img src="<%=basePath%>images/login_logo.gif" width="318" height="81" /></div>
	<div class="txt">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
						<th>用户名</th>
						<td colspan="2"><input id="j_username" name="j_username" type="text" class="inputtxt2" style="width:190px" tabindex="1" validConf="required" value="${sessionScope['SPRING_SECURITY_LAST_USERNAME']}"/></td>
				</tr>
				<tr>
						<th>密码</th>
						<td colspan="2"><input id="j_password" name="j_password" type="password" class="inputtxt2" style="width:190px" tabindex="2" validConf="required"/></td>
				</tr>
				<tr>  
                         <th><label for="j_captcha">验证码:</label></th>  
                         <td>  
                             <input type='text' name='j_captcha' class="required" size='5' />  
                             <img id="captchaImg" src="<%=basePath%>image/jcaptcha.jpg" alt="" height="30">
                             <span style="margin-left: 25px"><a href="javascript:refreshCaptcha()">看不清楚换一张</a></span>
                         </td>  
                </tr> 
				<tr>
				        <th></th>
						<td>
                             <input id="_spring_security_remember_me" name="_spring_security_remember_me" type="checkbox" value="true"/>  
                             <label for="_spring_security_remember_me">Remember Me?</label>  
						</td>
				</tr>
				<tr>
						<th>&nbsp;</th>
						<td><input name="登录" type="submit" value="登录"/></td>
				</tr>
		</table>
	</div>
</div>
</form>
  </body>
  <script type="text/javascript">  
function refreshCaptcha() {  
    $('#captchaImg').hide().attr(  
            'src',  
            '<%=basePath%>image/jcaptcha.jpg' + '?' + Math  
                    .floor(Math.random() * 100)).fadeIn();  
}  
</script>  
</html>
